package lk.icta.core.dao;

import lk.icta.core.entity.Organization;
import lk.icta.user.entity.User;

import java.util.List;
import java.util.Map;

/**
 * @author Tharanga Punchihewa
 */
public interface OrganizationDAO {
    /**
     * Add a Organization
     *
     * @param organization The organization to be added
     * @param user         User requesting to add the Organization
     */
    public void addOrganization(Organization organization, User user);

    /**
     * Update a Organization
     *
     * @param organization The organization to be updated
     * @param user         User requesting to update the Organization
     */
    public void updateOrganization(Organization organization, User user);

    /**
     * Update a Organization due date
     *
     * @param organization The organization to be updated
     * @param user         User requesting to update the Organization
     */
    public void updateDueDate(Organization organization, User user);

    /**
     * Returns a Organization to the given land id
     *
     * @param idUKey idUKey of the Organization
     * @param user   User requesting to search the organization
     * @return The Organization corresponding to the given id
     */
    public Organization getOrganizationByIdUKey(int idUKey, User user);

    /**
     * get  all organizations
     *
     * @param user The user requesting to Organization List
     * @return Organization
     */
    public List<Organization> getAllOrganizations(User user);


    /**
     * get  organizations List
     *
     * @param language user preferred language
     * @return Organization list
     */
    public Map<Integer, String> getOrganizationListByLanguage(String language);

    /**
     * get  organizations List  by type (Registered or unregistered organization)
     *
     * @param type type of  the organization
     * @param user The user requesting to Organization List
     * @return Organization list
     */
    public List<Organization> getOrganizationListByType(Organization.Type type, User user);

    /**
     * get Organization List By State And type
     *
     * @param state state of the organization
     * @param type  type of the organization  (active or inactive)
     * @param user  The user requesting the operation
     * @return Organization list
     */
    public List<Organization> getOrganizationListByStateAndType(Organization.State state, Organization.Type type, User user);

    /**
     * get  Active  organizations List
     *
     * @param state state of the organization
     * @return Active Organization list
     */
    public List<Organization> getOrganizationListByState(Organization.State state);
}
